home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Disks.p < prev    next >
Text File  |  1996-05-01  |  3KB  |  109 lines

  1. {
  2.      File:        Disks.p
  3.  
  4.      Contains:    Disk Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Disks;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DISKS__}
  28. {$SETC __DISKS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DisksIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __OSUTILS__}
  38. {$I OSUtils.p}
  39. {$ENDC}
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45.  
  46. CONST
  47.     sony                        = 0;
  48.     hard20                        = 1;
  49.  
  50. {
  51.     Note:
  52.     
  53.     qLink is usually the first field in queues, but back in the MacPlus
  54.     days, the DrvSts record needed to be expanded.  In order to do this without
  55.     breaking disk drivers that already added stuff to the end, the fields 
  56.     where added to the beginning.  This was originally done in assembly language
  57.     and the record was defined to start at a negative offset, so that the qLink
  58.     field would end up at offset zero.  When the C and pascal interfaces where
  59.     made, they could not support negative record offsets, so qLink was no longer
  60.     the first field.  Universal Interfaces are auto generated and don't support
  61.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a 
  62.     none zero offset.  Assembly code which switches to Universal Interfaces will
  63.     need to compensate for that.
  64.  
  65. }
  66.  
  67. TYPE
  68.     DrvStsPtr = ^DrvSts;
  69.     DrvSts = RECORD
  70.         track:                    INTEGER;                                {  current track  }
  71.         writeProt:                SignedByte;                                {  bit 7 = 1 if volume is locked  }
  72.         diskInPlace:            SignedByte;                                {  disk in drive  }
  73.         installed:                SignedByte;                                {  drive installed  }
  74.         sides:                    SignedByte;                                {  -1 for 2-sided, 0 for 1-sided  }
  75.         qLink:                    QElemPtr;                                {  next queue entry  }
  76.         qType:                    INTEGER;                                {  1 for HD20  }
  77.         dQDrive:                INTEGER;                                {  drive number  }
  78.         dQRefNum:                INTEGER;                                {  driver reference number  }
  79.         dQFSID:                    INTEGER;                                {  file system ID  }
  80.         CASE INTEGER OF
  81.         0: (
  82.             twoSideFmt:            SignedByte;                                {  after 1st rd/wrt: 0=1 side, -1=2 side  }
  83.             needsFlush:            SignedByte;                                {  -1 for MacPlus drive  }
  84.             diskErrs:            INTEGER;                                {  soft error count  }
  85.            );
  86.         1: (
  87.             driveSize:            INTEGER;
  88.             driveS1:            INTEGER;
  89.             driveType:            INTEGER;
  90.             driveManf:            INTEGER;
  91.             driveChar:            INTEGER;
  92.             driveMisc:            SignedByte;
  93.            );
  94.     END;
  95.  
  96. FUNCTION DiskEject(drvNum: INTEGER): OSErr;
  97. FUNCTION SetTagBuffer(buffPtr: UNIV Ptr): OSErr;
  98. FUNCTION DriveStatus(drvNum: INTEGER; VAR status: DrvSts): OSErr;
  99. {$ALIGN RESET}
  100. {$POP}
  101.  
  102. {$SETC UsingIncludes := DisksIncludes}
  103.  
  104. {$ENDC} {__DISKS__}
  105.  
  106. {$IFC NOT UsingIncludes}
  107.  END.
  108. {$ENDC}
  109.